package com.appoint.common.utils;

import lombok.extern.log4j.Log4j2;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * @author bd
 * @date 2021/2/1413:26
 */
@Log4j2
public class RandomUtils {

    /**
     * 获取19位随机数
     */
    public static String getNum19() {
        try {
            Thread.sleep(1);
        } catch (Exception ignored) {
        }
        String trandStr = String.valueOf((Math.random() * 9 + 1) * 1000000);
        String dataStr = new SimpleDateFormat("yyyyMMddHHmmSSsss").format(new Date());
        return dataStr + trandStr.toString().charAt(0);
    }

    public static String getUUID32() {
        return UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
    }
}
